<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			var cities = [
				["哈尔滨","漠河"],
				["长春","白城"],
				["大连","铁岭"]
			]
			function change(){
				var sel1 = document.getElementById("province")
				var pid = sel1.value
				// console.log(pid)
				//获取城市
				var cs = cities[pid];
				var sel2 = document.getElementById("city")
				//删除所有城市
				sel2.innerHTML = "<option>请选择</option>"
				//添加城市
				for(var i = 0;i<cs.length;i++){
					var opn = document.createElement("option")
					opn.innerHTML = cs[i]
					//追加
					sel2.append(opn)
				}
			}
		</script>
	</head>
	<body>
		省份：<select name="" id="province" onchange="change()">
			<option>请选择</option>
			<option value="0">黑龙江</option>
			<option value="1">吉林</option>
			<option value="2">辽宁</option>
		</select>
		城市：<select name="" id="city">
			
		</select>
	</body>
</html>